package com.jed.xxh.application;

import android.app.Application;
import android.content.Context;

import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
import com.jed.xxh.utils.StaticClass;
import com.tencent.bugly.crashreport.CrashReport;

import cn.bmob.v3.Bmob;

/**
 * <p>项目名：stewardAPP</p>
 * <p>包名：  com.jed.xxh.application</p>
 * <p>文件名：BaseApplication</p>
 * <p>作者：徐晓辉</p>
 * <p>创建日期：2018/11/24</p>
 * <p>描述：BaseApplication</p>
 */
public class BaseApplication extends Application {

    /**
     * 系统上下文
     */
    private static Context mAppContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mAppContext = getApplicationContext();

        //初始化腾讯Bugly
        CrashReport.initCrashReport(getApplicationContext(), StaticClass.BUGLY_APP_ID, false);

        //初始化Bmob
        Bmob.initialize(this, StaticClass.BMOB_APP_ID);

        // 将“12345678”替换成您申请的APPID，申请地址：http://www.xfyun.cn
        // 请勿在“=”与appid之间添加任何空字符或者转义符
        SpeechUtility.createUtility(getApplicationContext(), SpeechConstant.APPID + "=" + StaticClass.XFYUN_KD_VOICE_KEY);
    }

    /**
     * 获取系统上下文：用于Util类
     */
    public static Context getAppContext() {
        return mAppContext;
    }
}
















